//
//  ViewController.m
//  JXWaveAnimationDemo
//
//  Created by raymond on 16/12/6.
//  Copyright © 2016年 raymond. All rights reserved.
//

#import "ViewController.h"
#import "JXWaveView.h"

@interface ViewController ()

@property (nonatomic, strong) JXWaveView *waveView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    JXWaveView *waveView = [JXWaveView loadingView];
    waveView.center = self.view.center;
    self.waveView = waveView;
    [self.view addSubview:waveView];

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [waveView startLoading];
    });
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    if (self.waveView.isLoading) {
        [self.waveView stopLoading];
    } else {
        [self.waveView startLoading];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
